<?php

/**
 * Aurorum - Open source digital signage
 *
 * @link http://digitalsignage.tk
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 *
 * @category Aurorum
 * @package Aurorum
 */

/**
 * This class listens to Wordpress events. If one appears then class tries 
 * to dispatch request.  
 *
 * @package Aurorum
 * @subpackage Core
 */

class ADS_Observer{
    
    private static $hooks = array();
    
    public static function inspectRequest(){
        $page = ADS_Input::getVar('page', null);
        if(!is_null($page) && isset(self::$hooks[$page])){
            call_user_func(self::$hooks[$page]);
        }
    }
    
    public static function registerHook($label, $hook){
        self::$hooks[$label] = $hook;
    }
}
